﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

namespace StarForce {
    public class AtlasManager
    {
        private static Dictionary<string,AtlasData> AltasDic = new Dictionary<string, AtlasData>();
        public static readonly string CardAtlasName = "CardIconAltas";

        public static void InitData(string atlasName,AtlasData atlasData) {
            AltasDic.Add(atlasName,atlasData);
        }

        public static Sprite GetSprite(string spriteName) {
            AtlasData data = null;
            AltasDic.TryGetValue(CardAtlasName, out data);
            if (data == null) {
                return null;
            }
            return data.GeSpriteByName(spriteName);
        }
    }
}

